// pcinfo.js
Page({
    data: {
      pcinfos: [],
    },
    onLoad: function() {
      var that = this;
      wx.request({
        url: 'http://localhost:9090/allWithBrand',
        method: 'GET',
        success(res) {
          console.log(res.data);
          that.setData({
            pcinfos: res.data
          });
        },
        fail(err) {
          console.error(err);
        }
      });
    },
  
    toggleCard: function (e) {
      const index = e.currentTarget.dataset.index;
      let pcinfos = this.data.pcinfos;
      pcinfos[index].expanded = !pcinfos[index].expanded;
      this.setData({
        pcinfos: pcinfos
      });
    }
  })